import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_basic/entry_page.dart';
import 'package:flutter_basic/modules/main/main_page.dart';
import 'package:flutter_basic/modules/mine/settings/controller.dart';
import 'package:flutter_basic/modules/mine/settings/settings_page.dart';
import 'package:get/get.dart';
import 'modules/guide/controller.dart';
import 'modules/guide/guide_page.dart';
import 'modules/home/controller.dart';
import 'modules/home/home_page.dart';
import 'modules/home/property_list/controller.dart';
import 'modules/home/property_list/property_list_page.dart';
import 'modules/login/controller.dart';
import 'modules/login/login_page.dart';
import 'modules/main/controller.dart';
import 'modules/mine/controller.dart';
import 'modules/mine/mine_page.dart';


class RouteManager{

  static const String login = '/login';
  static const String customer = '/customer';
  static const String guide = '/guide';
  static const String home = '/home';
  static const String mine = '/mine';
  static const String main = '/main';
  static const String entry = '/entry';
  static const String settings = '/setting';
  static const String propertyList = '/propertyList';

  static List<GetPage> getPages = <GetPage>[
    GetPage(
        name: login,
        page: () => LoginPage.bind(LoginPageController()),
    ),
    GetPage(
      name: guide,
      page: () => GuidePage.bind(GuidePageController()),
    ),
    GetPage(
      name: mine,
      page: () => MinePage.bind(MineController()),
    ),
    GetPage(
      name: home,
      page: () => HomePage.bind(HomeController()),
    ),
    GetPage(
      name: main,
      page: () => MainPage.bind(MainPageController()),
    ),
    GetPage(
      name: entry,
      page: () => EntryPage(),
    ),
    GetPage(
      name: settings,
      page: () => SettingsPage.bind(SettingsPageController()),
    ),
    GetPage(
      name: propertyList,
      page: () => PropertyListPage.bind(PropertyListPageController(inTheTab: false)),
    ),
  ];

  /// 路由管理器
  static Map<String, WidgetBuilder> routes1 = {
    login: (context) => LoginPage.bind(LoginPageController()),
    guide: (context) => GuidePage.bind(GuidePageController()),
    mine: (context) => MinePage.bind(MineController()),
    home: (context) => HomePage.bind(HomeController()),
    main: (context) => MainPage.bind(MainPageController()),
    entry: (context) => EntryPage(),
    settings: (context) => SettingsPage.bind(SettingsPageController()),
  };

  static WidgetBuilder generateWidgetBuilder(Widget page){
    return (context) => page;
  }
}